package com.xfcy.blog.service.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.xfcy.blog.common.R;
import com.xfcy.blog.mapper.AdminLogMapper;
import com.xfcy.blog.entity.AdminLog;
import com.xfcy.blog.service.AdminLogService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * (AdminLog)表服务实现类
 *
 * @author 晓风残月Lx
 * @since 2023-04-09 10:59:51
 */
@Service("adminLogService")
public class AdminLogServiceImpl extends ServiceImpl<AdminLogMapper, AdminLog> implements AdminLogService {

    /**
     * 操作日志列表
     * @param pageNo
     * @param pageSize
     * @return
     */
    @Override
    public R listAdminLog(Integer pageNo, Integer pageSize) {
        Page<AdminLog> adminLogPage = baseMapper.selectPage(new Page<>(pageNo, pageSize), null);
        return R.success(adminLogPage);
    }

    /**
     * 删除操作日志
     * @param ids
     * @return
     */
    @Override
    @Transactional(rollbackFor = Exception.class)
    public R deleteAdminLog(List<Long> ids) {
        baseMapper.deleteBatchIds(ids);
        return R.success();
    }


}


